package com.ruoyi.flowable.service;

import com.ruoyi.flowable.domain.WorkOrderAssetRel;

import java.util.List;
import java.util.Map;

/**
 * 工单资产关联Service接口
 */
public interface IWorkOrderAssetRelService {
    /**
     * 根据ID查询
     */
    WorkOrderAssetRel selectWorkOrderAssetRelById(Long id);

    /**
     * 查询列表
     */
    List<WorkOrderAssetRel> selectWorkOrderAssetRelList(WorkOrderAssetRel workOrderAssetRel);

    /**
     * 新增
     */
    int insertWorkOrderAssetRel(WorkOrderAssetRel workOrderAssetRel);

    /**
     * 修改
     */
    int updateWorkOrderAssetRel(WorkOrderAssetRel workOrderAssetRel);

    /**
     * 删除
     */
    int deleteWorkOrderAssetRelById(Long id);

    /**
     * 根据流程实例ID查询（主要查询方法）
     */
    WorkOrderAssetRel selectByProcInsId(String procInsId);

    /**
     * 根据资产ID查询工单记录
     */
    List<WorkOrderAssetRel> selectByAssetId(Long assetId);

    /**
     * 根据流程实例ID列表批量查询
     */
    List<WorkOrderAssetRel> selectByProcInsIds(List<String> procInsIds);

    /**
     * 根据流程实例ID列表批量查询(map)
     */
    Map<String, WorkOrderAssetRel> getMapByProcInstIds(List<String> procInsIds);

    /**
     * 根据流程实例ID删除记录
     */
    int deleteByProcInsId(String procInsId);

    /**
     * 根据资产ID删除记录
     */
    int deleteByAssetId(Long assetId);

    /**
     * 更新工单状态
     */
    int updateWorkOrderStatus(String procInsId, String workOrderStatus, java.util.Date finishTime);

    /**
     * 更新预计完成时间
     */
    int updatePlanFinishTime(String procInsId, java.util.Date planFinishTime);

    /**
     * 更新资产信息
     */
    int updateAssetInfo(String procInsId, Long assetId, String assetName, String assetNumber);

    /**
     * 查询我的工单列表
     */
    List<WorkOrderAssetRel> selectMyWorkOrders(Long userId, String status, String procDefName, String assetName);

    /**
     * 批量新增工单资产关联
     */
    int batchInsertWorkOrderAssetRel(List<WorkOrderAssetRel> workOrderAssetRelList);

    /**
     * 根据流程实例ID批量删除
     */
    int batchDeleteByProcInsIds(List<String> procInsIds);
}
